<%@ page import="com.casework.Measure" %>
<!doctype html>
<html>
<head>
    <meta name="layout" content="main">
    <g:set var="entityName" value="${message(code: 'measure.label', default: 'Measure')}"/>
    <title><g:message code="default.list.label" args="[entityName]"/></title>
</head>

<body>
<a href="#list-measure" class="skip" tabindex="-1"><g:message code="default.link.skip.label"
                                                              default="Skip to content&hellip;"/></a>
<sec:ifAllGranted roles="ROLE_ADMIN">
<div class="nav" role="navigation">
    <ul>
        <li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
    </ul>
</div>
</sec:ifAllGranted>

<div id="list-measure" class="content scaffold-list" role="main">
    <casework:title total="${measureInstanceTotal}" title="Measures"/>
    <g:if test="${flash.message}">
        <div class="message" role="status">${flash.message}</div>
    </g:if>
    <table>
        <thead>
        <tr>

            <g:sortableColumn property="legalCase.ecNumber"
                              title="${message(code: 'legalCase.ecNumber.label', default: 'EC Number')}"/>

            <th>Notifying Parties</th>
            <th>Industry</th>

            <g:sortableColumn property="competitionConcern"
                              title="${message(code: 'measure.competitionConcern.label', default: 'Competition Concern')}"/>

            <g:sortableColumn property="measureClassification"
                              title="${message(code: 'measure.measureClassification.label', default: 'Measure Classification')}"/>

        </tr>
        </thead>
        <tbody>
        <g:each in="${measureInstanceList}" status="i" var="measureInstance">
            <tr class="${(i % 2) == 0 ? 'even' : 'odd'}">

                <td><search:highlight>
                        <g:link action="show" controller="measure"
                            id="${measureInstance.id}">M.${measureInstance?.legalCase.ecNumber}</g:link>
                    </search:highlight>
                </td>

                <td><search:highlight>${fieldValue(bean: measureInstance.legalCase, field: "firms")}</search:highlight></td>
                <td><search:highlight>${fieldValue(bean: measureInstance.legalCase, field: "industry")}</search:highlight></td>
                <td><search:highlight>${fieldValue(bean: measureInstance, field: "competitionConcern")}</search:highlight></td>
                <td><search:highlight>${fieldValue(bean: measureInstance, field: "measureClassification")}</search:highlight></td>

            </tr>
        </g:each>
        </tbody>
    </table>

    <div class="pagination">
        <casework:paginate total="${measureInstanceTotal}"/>
        <casework:viewAll />
    </div>
</div>
</body>
</html>
